home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / wpjv1n5.zip / WINSTUB.ZIP / WINSTUB.CPP next >
C/C++ Source or Header  |  1993-04-30  |  655b  |  29 lines

  1. // Enhanced WINSTUB.EXE for Windows applications
  2.  
  3. #include <process.h>
  4. #include <stddef.h>
  5. #include <iostream.h>
  6.  
  7. char answer;
  8. int returncode;
  9.  
  10. int main(void)
  11. {
  12.   cerr << "\nThis program requires Microsoft Windows to run.";
  13.   cerr << "\nWould you like me to start Microsoft Windows for you? ";
  14.   cin >> answer;
  15.   if (answer == 'y' || answer == 'Y')
  16.     {
  17.       returncode = spawnlp(P_WAIT,"win.com","","address",NULL);
  18.       if (returncode<0)
  19.     {
  20.       cerr << "\n\nError, could not start Microsoft Windows.";
  21.       cerr << "\nExiting back to DOS...";
  22.     }
  23.     }
  24.   else
  25.     cerr << "\n\nExiting back to DOS...";
  26.  
  27.   return returncode;
  28. }
  29.